import 'package:flutter/material.dart';
import '../model/twolist.dart';
import '../service/service_method.dart';

class Goodslist with ChangeNotifier {
  Twoclassification goodlist = null;
  List<GoodData> goodlitsData = [];
  //获取二级分类商品

  getgoodlist(String id1, String id2, int page) async {
    print("我运行了+++++++++++++++++++++++++++++");
    print(page);
    var formData = {
      "category_id1": id1,
      "category_id2": id2,
      "page": page,
    };
    await DioUtil.request('getCateGoodData', formData: formData).then((val) {
      var responseDatas = val;
      // print(responseDatas);
      goodlist = Twoclassification.fromJson(responseDatas);
      goodlitsData=[];
      print(goodlitsData);
      print("==================");
      goodlitsData = goodlist.data.goodData;
      print(goodlitsData);
      print(responseDatas);
      
      
    });
  }
  //页数增加

}
